@extends('newAdmin.layout.main')

@section('content')
    <div class="x-nav">
      <span class="layui-breadcrumb">
        <a href="">首页</a>
        <a href="">权限管理</a>
        <a>
          <cite>权限列表</cite>
        </a>
      </span>
        <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" href="javascript:location.replace(location.href);" title="刷新">
            <i class="layui-icon" style="line-height:30px">ဂ 刷新</i>
        </a>
    </div>
    <div class="x-body">
        <div class="layui-inline">
            <form action="{{url('backstage/user/auth')}}" class="layui-form layui-col-md12 x-so" style="margin-bottom: 0" method="get">
                <input type="text" name="keywords"  placeholder="请输入权限名" autocomplete="off" class="layui-input">
                <button class="layui-btn" lay-submit="" lay-filter="sreach"><i class="layui-icon">&#xe615;</i></button>
            </form>
        </div>
        <div class="layui-inline">
            <button class="layui-btn" onclick="x_admin_show('新增', '{{url("backstage/user/auth/store")}}')">新增</button>
        </div>
        <table class="layui-table">
            <thead>
            <tr>
                <th>ID</th>
                <th>权限名</th>
                <th>添加时间</th>
                <th>操作</th></tr>
            </thead>
            <tbody>
            @foreach($auths as $auth)
                <tr>
                    <td>{{$auth->id}}</td>
                    <td>{{$auth->name}}</td>
                    <td>{{$auth->create_time}}</td>
                    <td class="td-manage">
                        <a onclick="x_admin_show('编辑权限信息','{{url("backstage/user/auth/$auth->id/edit")}}')" title="编辑权限信息" href="javascript:;">
                            <i class="layui-icon font-24">&#xe642;</i>
                        </a>
                        <a onclick="x_admin_show('{{$auth->name}}','{{url("backstage/user/auth/$auth->id/give")}}')" title="赋予角色权限" href="javascript:;">
                            <i class="layui-icon font-24">&#xe631;</i>
                        </a>
                    </td>
                </tr>
            @endforeach
            </tbody>
        </table>
        <div class="page">
            {{$auths->appends(['keywords' => $keywords])->links()}}
        </div>
    </div>
@endsection
